import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LoginComponent } from './login.component';
import { ForgotPassComponent } from './forgotPass/forgotPass.component';
import { StorageService } from '../../shared/services/storage.service';
import { AuthenticationService } from './login.service';
import { UtilsService } from '../../shared/services/utils.service';
import { FormsModule } from '@angular/forms';
import { RouterModule, Routes } from '@angular/router';
import { ChangePassComponent } from './changetPass/changePass.component';
import { PipesModule } from '../../shared/pipes/pipes.module';
import { ClientAgreementComponent } from './agreement/client-agreement.component';
import { ModalModule } from '../../shared/components/modal/modal.module';
import { ProspectAgreementComponent } from './agreement/prospect-agreement.component';
import { CookieService } from 'ngx-cookie-service';

const routes: Routes = [
    {
        path: '',
        component : LoginComponent
    },
    {
        path: 'ip',
        component: LoginComponent
    },
    {
        path: 'reset',
        component: ForgotPassComponent
    },
    {
        path: 'change/:email/:temp',
        component: ChangePassComponent
    }
];

/**
 * Login module
 *
 * Author: Sorin Spiru, Andrei Istrate
 * Date: 13.01.2018
 */
@NgModule({
    providers: [
        StorageService,
        AuthenticationService,
        UtilsService,
        CookieService
    ],
    imports: [
        FormsModule,
        CommonModule,
        PipesModule,
        RouterModule.forChild(routes),
        ModalModule
    ],
    declarations: [
        LoginComponent,
        ForgotPassComponent,
        ChangePassComponent,
        ClientAgreementComponent,
        ProspectAgreementComponent
    ],
    exports: [
        LoginComponent,
        ForgotPassComponent,
        ClientAgreementComponent,
        ProspectAgreementComponent
    ]
})
export class LoginModule { }
